package com.fund.product.controller;

import com.fund.api.entity.TradeOrder;
import com.fund.common.pojo.Result;
import com.fund.product.service.ShareHoldingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/shareHolding")
public class ShareHoldingController {

    @Autowired
    ShareHoldingService shareHoldingService;

    /**
     * 根据订单更新持有份额
     * @param tradeOrders 涉及订单
     * @return 是否成功
     */
    @PutMapping
    public Result<Boolean> updateShareHoldings(List<TradeOrder> tradeOrders) {
        return shareHoldingService.updateShareHoldings(tradeOrders);
    }
}
